package com.catering.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.catering.pojo.DOrder;
import com.catering.service.DOrderService;
import com.catering.mapper.DOrderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 徐
* @description 针对表【d_order】的数据库操作Service实现
* @createDate 2025-04-11 10:44:25
*/
@Service
public class DOrderServiceImpl extends ServiceImpl<DOrderMapper, DOrder>
    implements DOrderService{
    @Autowired
    private DOrderMapper dOrderMapper;

    @Override
    public Integer insertOrder(DOrder order) {
        dOrderMapper.insertOrder(order);
        return null;
    }

    @Override
    public DOrder selectByOrder(Integer uid,Integer id) {
        return dOrderMapper.selectByOrder(uid,id);
    }

    @Override
    public void deleteByOrder(Integer id) {
         dOrderMapper.deleteByOrder(id);
    }

    @Override
    public DOrder selectByDateAndPhone(String orderDate, String phone) {
        DOrder dOrder = dOrderMapper.selectByDateAndPhone(orderDate, phone);
        return dOrder;
    }

    @Override
    public List<DOrder> selectByUid(Integer uid) {
        List<DOrder> dOrders = dOrderMapper.selectByUid(uid);
        return dOrders;
    }

    @Override
    public DOrder selectByOrder1(Integer uid, Integer id) {
        return dOrderMapper.selectByOrder1(uid, id);
    }
    @Override
    public DOrder selectByTimeRange(Integer uid, String phone, String startTime, String endTime) {
        return dOrderMapper.selectByTimeRange(uid, phone, startTime, endTime);
    }
}




